// mock/user.bundled_e1bt1rb7zva.mjs
function createUserList() {
  return [
    {
      userId: 1,
      avatar: "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      username: "admin",
      password: "111111",
      desc: "\u5E73\u53F0\u7BA1\u7406\u5458",
      roles: ["\u5E73\u53F0\u7BA1\u7406\u5458"],
      buttons: ["cuser.detail"],
      routes: ["home"],
      token: "Admin Token"
    },
    {
      userId: 2,
      avatar: "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      username: "system",
      password: "111111",
      desc: "\u7CFB\u7EDF\u7BA1\u7406\u5458",
      roles: ["\u7CFB\u7EDF\u7BA1\u7406\u5458"],
      buttons: ["cuser.detail", "cuser.user"],
      routes: ["home"],
      token: "System Token"
    }
  ];
}
var user_default = [
  //  用户登录接口
  {
    url: "/api/user/login",
    method: "post",
    response: ({ body }) => {
      const { username, password } = body;
      const checkUser = createUserList().find(
        (item) => item.username === username && item.password === password
      );
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: "\u8D26\u53F7\u5BC6\u7801\u4E0D\u6B63\u786E"
          }
        };
      }
      const { token } = checkUser;
      return {
        code: 200,
        data: {
          token
        }
      };
    }
  },
  // 获取用户信息接口
  {
    url: "/api/user/info",
    method: "get",
    response: (request) => {
      const token = request.headers.token;
      const checkUser = createUserList().find((item) => {
        return item.token === token;
      });
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: "\u83B7\u53D6\u7528\u6237\u4FE1\u606F\u5931\u8D25"
          }
        };
      }
      return {
        code: 200,
        data: {
          checkUser
        }
      };
    }
  }
];
export {
  user_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibW9jay9tb2NrL3VzZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiQzpcXFxcVXNlcnNcXFxcODYxMzVcXFxcRG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gICAgICBjb25zdCBjaGVja1VzZXIgPSBjcmVhdGVVc2VyTGlzdCgpLmZpbmQoXHJcbiAgICAgICAgICAgICAgICAoaXRlbSk9Pml0ZW0udXNlcm5hbWUgPT09IHVzZXJuYW1lICYmIGl0ZW0ucGFzc3dvcmQgPT09IHBhc3N3b3JkXHJcbiAgICAgICAgICAgIClcclxuICAgICAgICAvLyAgICAgXHU2Q0ExXHU2NzA5XHU3NTI4XHU2MjM3XHU4RkQ0XHU1NkRFXHU1OTMxXHU4RDI1XHU0RkUxXHU2MDZGXHJcbiAgICAgICAgICAgIGlmKCFjaGVja1VzZXIpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29kZTogMjAxLFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6e1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOidcdThEMjZcdTUzRjdcdTVCQzZcdTc4MDFcdTRFMERcdTZCNjNcdTc4NkUnXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgLy8gICAgIFx1NjcwOVx1NTIxOVx1OEZENFx1NTZERVx1NjIxMFx1NTI5Rlx1NEZFMVx1NjA2RlxyXG4gICAgICAgICAgICBjb25zdCB7dG9rZW59ID0gY2hlY2tVc2VyXHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICBjb2RlOjIwMCxcclxuICAgICAgICAgICAgICAgIGRhdGE6e1xyXG4gICAgICAgICAgICAgICAgICAgIHRva2VuXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAgLy8gXHU4M0I3XHU1M0Q2XHU3NTI4XHU2MjM3XHU0RkUxXHU2MDZGXHU2M0E1XHU1M0UzXHJcbiAgICB7XHJcbiAgICAgICAgdXJsOicvYXBpL3VzZXIvaW5mbycsXHJcbiAgICAgICAgbWV0aG9kOidnZXQnLFxyXG4gICAgICAgIHJlc3BvbnNlOihyZXF1ZXN0KSA9PiB7XHJcbiAgICAgICAgLy8gICAgIFx1ODNCN1x1NTNENlx1OEJGN1x1NkM0Mlx1NTkzNFx1NjQzQVx1NUUyNnRva2VuXHJcbiAgICAgICAgICAgIGNvbnN0IHRva2VuID0gcmVxdWVzdC5oZWFkZXJzLnRva2VuXHJcbiAgICAgICAgLy8gICAgIFx1NjdFNVx1NzcwQlx1NzUyOFx1NjIzN1x1NEZFMVx1NjA2Rlx1NjYyRlx1NTQyNlx1NTMwNVx1NTQyQlx1NjcwOVx1NkIyMXRva2VuXHU3NTI4XHU2MjM3XHJcbiAgICAgICAgICAgIGNvbnN0IGNoZWNrVXNlciA9IGNyZWF0ZVVzZXJMaXN0KCkuZmluZCgoaXRlbSk9PntcclxuICAgICAgICAgICAgICAgIHJldHVybiBpdGVtLnRva2VuID09PSB0b2tlblxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBpZighY2hlY2tVc2VyKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IDIwMSxcclxuICAgICAgICAgICAgICAgICAgICBkYXRhOntcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTonXHU4M0I3XHU1M0Q2XHU3NTI4XHU2MjM3XHU0RkUxXHU2MDZGXHU1OTMxXHU4RDI1J1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIGNvZGU6IDIwMCxcclxuICAgICAgICAgICAgICAgIGRhdGE6e1xyXG4gICAgICAgICAgICAgICAgICAgIGNoZWNrVXNlclxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgIC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